package com.ruoyi.project.ypjxc.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.framework.web.domain.BaseEntity;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;
import java.util.Objects;

public class Order extends BaseEntity {
    private String orderId;
    private String supplierName;
    private Double orderSumprice;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date orderPuttime;
    private String drugType;
    private String status;
    private String proposer;
    private List<Buy> buyList;


    public String getDrugType() {
        return drugType;
    }

    public void setDrugType(String drugType) {
        this.drugType = drugType;
    }

    public List<Buy> getBuyList() {
        return buyList;
    }

    public void setBuyList(List<Buy> buyList) {
        this.buyList = buyList;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public String getSupplierName() {
        return supplierName;
    }

    public void setSupplierName(String supplierName) {
        this.supplierName = supplierName;
    }

    public Double getOrderSumprice() {
        return orderSumprice;
    }

    public void setOrderSumprice(Double orderSumprice) {
        this.orderSumprice = orderSumprice;
    }

    public Date getOrderPuttime() {
        return orderPuttime;
    }

    public void setOrderPuttime(Date orderPuttime) {
        this.orderPuttime = orderPuttime;
    }

    public String getDrug_type() {
        return drugType;
    }

    public void setDrug_type(String drugType) {
        this.drugType = drugType;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getProposer() {
        return proposer;
    }

    public void setProposer(String proposer) {
        this.proposer = proposer;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Order order = (Order) o;
        return Objects.equals(orderId, order.orderId) &&
                Objects.equals(supplierName, order.supplierName) &&
                Objects.equals(orderSumprice, order.orderSumprice) &&
                Objects.equals(orderPuttime, order.orderPuttime) &&
                Objects.equals(drugType, order.drugType) &&
                Objects.equals(status, order.status) &&
                Objects.equals(proposer, order.proposer);
    }

    @Override
    public int hashCode() {
        return Objects.hash(orderId, supplierName, orderSumprice, orderPuttime, drugType, status, proposer);
    }

    @Override
    public String toString() {
        return "Order{" +
                "orderId='" + orderId + '\'' +
                ", supplierName='" + supplierName + '\'' +
                ", orderSumprice=" + orderSumprice +
                ", orderPuttime=" + orderPuttime +
                ", drugType='" + drugType + '\'' +
                ", status='" + status + '\'' +
                ", proposer='" + proposer + '\'' +
                '}';
    }

    public Order(String orderId, String supplierName, Double orderSumprice, Date orderPuttime, String drugType, String status, String proposer) {
        this.orderId = orderId;
        this.supplierName = supplierName;
        this.orderSumprice = orderSumprice;
        this.orderPuttime = orderPuttime;
        this.drugType = drugType;
        this.status = status;
        this.proposer = proposer;
    }

    public Order() {
    }
}
